home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-07 | 2.0 KB | 54 lines | [TEXT/ToyS] |
- -- This script is distributed as a text script instead of a compiled script because AppleScript
- -- has a habit of not being able to edit scripts that were compiled with older versions of
- -- AppleScript. To use this script in practice, change the "Quinn" in the line marked with
- -- a ••• to your Mr Prefman user name and then use the Script Editor’s Save as command
- -- to create an application out of the script.
-
- on quitIt(procname, procsig)
- -- quit the process with the given name and signature
- if procsig = «class ToyS» then
- -- don't quit the Script Editor, 'cause it makes development kinda hard
- else if procsig = «class aplt» then
- -- don't quit ourselves
- else
- -- some programs (such as Think Pascal and Eudora) have
- -- problems if you send them the saving parameter
- tell application procname to activate
- tell application procname to quit
- end if
- end quitIt
-
- on run
- -- do all sorts of logout-type things with the Finder
- tell application "Finder"
- -- close all windows
- close every window
- -- quit all processes
- -- be careful here, we must sample the process list before
- -- we start quitting processes otherwise the indexes get very confused
- -- get these things "as list" otherwise a single item
- -- comes back not in a list, which confuses the repeat loop
- set names to name of every process as list
- set types to creator type of every process as list
- -- now start quitting process
- repeat with i from 1 to length of names
- tell me to quitIt(item i of names, item i of types)
- end repeat
- -- now junk the server volumes, using a similar technique
- activate
- set names to name of every disk as list
- set locals to local volume of every disk as list
- repeat with i from (length of names) to 1 by -1
- if not item i of locals then
- put away disk (item i of names)
- end if
- end repeat
- end tell
- -- now tell Mr Prefman to establish Quinn's preference files
- tell application "Mr Prefman"
- activate
- switch to user "Quinn" -- •••
- quit
- end tell
- end run
-